﻿@{
    ViewBag.Title = "小杨工具库";
    var text = Request.QueryString["id"].xTrim();
    var idx= text.IndexOf('/');
    var docno = Request.QueryString["id"].xTo<int>();
    if (idx > 0)
    {
        docno = text.Substring(0, idx).xTo<int>();
    }
    if (docno <= 0)
    {
        Html.RenderPartial("Result", new YYS.ResultModel() { IsPart = 1, Icon = 5, Msg = "缺少必须的参数"+ docno, Title = "提示" });
        return;
    }

    var docObj = YYS.Controllers.pcController._wangEditorInfo(docno);
    if (docObj.HasError)
    {
        Html.RenderPartial("Result", new YYS.ResultModel() { IsPart = 1, Icon = 5, Msg = docObj.Error, Title = "提示" });
        return;
    }
    if (docObj.Obj==null)
    {
        Html.RenderPartial("Result", new YYS.ResultModel() { IsPart = 1, Icon = 5, Msg = "未查询到相关笔记", Title = "提示" });
        return;
    }
    ViewBag.Title = docObj.Obj["title"];
    var data = docObj.Obj.xConvertObjectToJson(false).xToBase64();
}
@section css{
    <link href="~/Content/index/wangeditor/index.css" rel="stylesheet" />
}
<div id="app" v-cloak >
    <div id="editor—wrapper">
        <div id="toolbar-container"><!-- 工具栏 --></div>
        <div id="editor-container" style=" max-width: 850px;margin:0 auto;">            
            <!-- 编辑器 -->
        </div>
    </div>
</div>
@section body{
    @*@System.Web.Optimization.Scripts.Render("~/Content/pc/helper.share")*@
    <script src="@Url.Content("~/Content/pc/wangeditor.js")"></script>
    <script src="@Url.Content("~/Content/index/wangeditor/index.js")"></script>
    @*<script src="~/Views/pc/helper/wangeditor.js"></script>*@
    <script>
        window.$jscript.fn.wangeditor.ready({ msg: '@(data)',link: '@(Url.Content("~/"))' })
    </script>
}
<style>
</style>